package com.moodair.pip.work;

import com.moodair.pip.core.InstanceBuildContext;
import com.moodair.pip.core.PipelineExecutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author MoodAir
 */
@Component
public class WorkApplicationRunner implements ApplicationRunner {
    
    @Autowired
    private PipelineExecutor pipelineExecutor;
    
    
    /**
     * Callback used to run the bean.
     *
     * @param args incoming application arguments
     */
    @Override
    public void run(ApplicationArguments args) {
        InstanceBuildContext instanceBuildContext = new InstanceBuildContext();
        pipelineExecutor.acceptSync(instanceBuildContext, "demo");
    }
}